{extends file="main.tpl"}
{block name=head}
<script type="text/javascript">
function getHide(thePlanningId,theIncomingId){
  var dataString = "planningId=" + thePlanningId + "&incomingId=" + theIncomingId;
	$.ajax({
		type: "GET",
		url: "getHide2.php",
		data: dataString,
		success:function(data)
		{
			$("#getData").html(data);
	  }
	});
}
</script>
{/block}
{block name=body}

<table border="0" cellpadding="0" cellspacing="0" align="center" width="100%">
<tr><td class="table1" align="center" colspan="2"><font size="3"><b>Planning & Log Sheet List</b></font></td></tr>
<tr>
  <td valign="top">
  	<table width="100%" border="1" cellpadding="2" cellspacing="0" >
    <tr>
    	<td align="center" class="table1" height="28">Process</td>
    	<td align="center" class="table1" height="28">Temperature</td>
    	<td align="center" class="table1" height="28">Soaking</td>
    	<td align="center" class="table1" height="28">Furnace</td>
    </tr>
    <tr>
    	<td align="center" NOWRAP>{$incommingArr.processName1}</td>
    	<td align="center">{$incommingArr.temp1}&deg;C</td>
    	<td align="center">{$incommingArr.soaking1}hrs</td>
    	<td align="center">{$incommingArr.furnace1}</td>
    </tr>
    {if $incommingArr.temp2 != 0}
    <tr>
    	<td align="center" NOWRAP>{$incommingArr.processName2}</td>
    	<td align="center">{$incommingArr.temp2}&deg;C</td>
    	<td align="center">{$incommingArr.soaking2}hrs</td>
    	<td align="center">{$incommingArr.furnace2}</td>
    </tr>
    {/if}
    {if $incommingArr.temp3 != 0}
    <tr>
    	<td align="center" NOWRAP>{$incommingArr.processName3}</td>
    	<td align="center">{$incommingArr.temp3}&deg;C</td>
    	<td align="center">{$incommingArr.soaking3}hrs</td>
    	<td align="center">{$incommingArr.furnace3}</td>
    </tr>
    {/if}
    </table>
  </td>
  <td valign="top">
  	<table width="100%" border="1" cellpadding="2" cellspacing="0" >
  		<tr align="center" class="table1">
			  <td class="table1">SheetNo</td>
			  <td class="table1">Log Date</td>
			  <td class="table1">StartTime</td>
			  <td class="table1">Start Temp.</td>
			  <td class="table1">Soaking StartTime</td>
			  <td class="table1">End Time</td>
			  <td class="table1">End Temperature</td>
			  <td class="table1">Quenching Media</td>
			  <td class="table1">Quenching Time</td>
			  <td class="table1">Temp BforQue</td>
			  <td class="table1">Temp AfterQue</td>
			</tr>
			{section name="sec" loop=$processArr}
			<tr>
				<!--input type="hidden" name="logSheetPlanningId" value="{$incommingArr.logSheetPlanningId}" />
				<input type="hidden" name="logSheetIncomingId" value="{$incommingArr.logSheetIncomingId}" />
				<input type="hidden" name="logSheetprocessId[]" value="{$processArr[sec].processNo}" />
				<input type="hidden" name="status[]" value="-1" />
				<input type="hidden" name="processNo[]" size="8" value="{$smarty.section.sec.rownum}" /-->
				<td align="center" {if $processArr[sec].toBeEditRecord == 1} style="background:pink;"{/if}>
					{$processArr[sec].logsheetNo}
				</td>
				<td nowrap>{$processArr[sec].logsheetDate}</td>
				<td align="center" NOWRAP>{$processArr[sec].startTime}</td>
				<td align="center">{$processArr[sec].startTemperature}</td>
				<td align="center" NOWRAP>{$processArr[sec].soakingStartTime}</td>
			  <td align="center" NOWRAP>{$processArr[sec].endTime}</td>
				<td align="center">{$processArr[sec].endTemperature}</td>
				<td align="center">{$processArr[sec].quenchingMedia}</td>
				<td align="center" NOWRAP>{$processArr[sec].quenchingTime} sec</td>
				<td align="center">{$processArr[sec].tempBforQue}</td>
				<td align="center">{$processArr[sec].tempAfterQue}</td>
			</tr>
			{/section}
    </table>
  </td>
</tr>
</table>
<form name="form1" id="form1" action="{$smarty.server.PHP_SELF}" method="post">
<table>
<tr>
  <td class="table1" colspan="12" align="center" ><font size="3"><b>Log Sheet Entry</b></font></td>
</tr>
{section name="sec" loop=$processArr}
{if $processArr[sec].toBeEditRecord == 1}
<tr align="center" class="table1">
  <td class="table1">&nbsp;&nbsp;</td>
  <td class="table1">LogsheetNo<br>No</td>
  <td class="table1">LogsheetDate</td>
  <td class="table1">StartTime</td>
  <td class="table1">Start<br>Temperature</td>
  <td class="table1">Soaking<br>StartTime</td>
  <td class="table1">End<br>Time</td>
  <td class="table1">End<br>Temperature</td>
  <td class="table1">Quenching<br>Media</td>
  <td class="table1">Quenching<br>Time</td>
  <td class="table1">Temp<br>BforQue</td>
  <td class="table1">Temp<br>AfterQue</td>
</tr>
<tr>
	<td class="table1">&nbsp;&nbsp;
		<input type="hidden" name="logSheetId" value="{$processArr[sec].logSheetId}" />
	</td>
	<td class="table1" align="center" style="background:pink;">
		<input type="text" name="logsheetNo" value="{$processArr[sec].logsheetNo}" size="8" required="required" />
	</td>
	<td class="table1" nowrap>{html_select_date prefix="logDate" time=$processArr[sec].logsheetDate start_year="-0" end_year="+2" field_order="DMY" month_format="%m" day_value_format="%02d"}</td>
	<td class="table1" align="center" NOWRAP>{html_select_time prefix=startTime time=$processArr[sec].showStartTime use_24_hours=true display_seconds=false }</td>
	<td class="table1" align="center"><input type="text" name="startTemperature" value="{$processArr[sec].startTemperature}" size="8"></td>
	<td class="table1" align="center" NOWRAP>{html_select_time prefix=soakStartTime time=$processArr[sec].showSoakingStartTime use_24_hours=true display_seconds=false }</td>
  <td class="table1" align="center" NOWRAP>{html_select_time prefix=endTime time=$processArr[sec].showEndTime use_24_hours=true display_seconds=false }</td>
	<td class="table1" align="center"><input type="text" name="endTemperature" value="{$processArr[sec].endTemperature}" size="8" ></td>
	<td class="table1" align="center"><select name="quenchingMedia" >{html_options values=$qmArray.qMId output=$qmArray.qMName selected=$processArr[sec].qMId}</select></td>
	<td class="table1" align="center" NOWRAP><input type="text" name="quenchingTime" value="{$processArr[sec].quenchingTime}" size="2" >sec</td>
	<td class="table1" align="center"><input type="text" name="tempBforQue" value="{$processArr[sec].tempBforQue}" size="8" ></td>
	<td class="table1" align="center"><input type="text" name="tempAfterQue" value="{$processArr[sec].tempAfterQue}" size="8" ></td>
</tr>
<tr>
  <td class="table1" colspan="12" align="center">
    <input type="submit" name="editbutton" value="Submit" class="button">
    <span class="button" style="margin-left:15px;"><a href="" onclick="window.close();" style="color:red;">Cancel</a></span>
  </td>
</tr>
{/if}
{sectionelse}
<tr><td class="table1" align="center"><font color="red">No Data to edit.</font></td></tr>
{/section}
</table>
</form>
{/block}